import { createRouter, createWebHistory } from 'vue-router'
import Layout from "../layout/index.vue";

export const defalutRoutes = [
    // {
    //     path: '/',
    //     component: Layout,
    //     redirect: '/dashboard',
    //     name: 'Index',
    //     meta: {
    //         title: '首页',
    //         icon : "icon-shouye"
    //     },
    //     children: [
    //         {
    //             path: '/dashboard',
    //             name: 'dashboard',
    //             component: () => import('@/views/dashboard/index.vue'),
    //             meta: {
    //                 title: '首页',
    //                 icon : "icon-shouye",
    //                 affix : true
    //             }
    //         }
    //     ]
    // },
    {
        path : "/auth-redirect",
        component: () => import('@/views/auth-redirect/index.vue'),
        hidden : true,
        meta: {
            title: '重定向',
        },
    },
    {
        path: '/404',
        component: () => import('@/views/error-page/404.vue'),
        hidden : true,
        meta: {
            title: '网页找不到啦~',
        }
    },
    {
        path: '/401',
        component: () => import('@/views/error-page/401.vue'),
        hidden : true,
        meta: {
            title: '暂无权限',
        }
    },
]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        ...defalutRoutes
    ]
})

export default router
